home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tpio24.zip / IO24DEMO.DOC < prev    next >
Text File  |  1993-01-04  |  4KB  |  77 lines

  1. DOCUMENTATION FOR IO24DEMO, IO24, DATE24 -- 8/22/89
  2.  
  3. Bill Meacham
  4. 1004 Elm Street
  5. Austin, Tx  78703
  6.  
  7. PUBLIC DOMAIN -- NO COPYRIGHT
  8.  
  9. The program IO24DEMO demonstrates a sophisticated method of controlling
  10. console data entry in Turbo Pascal version 4.0 and above.  It allows you
  11. precise control over where data entry occurs on the screen and makes your
  12. programs crash-proof from user input.  This is version 2.4.  I translated
  13. version 2.2 to Turbo Pascal version 4.0 and then recompiled under 5.0.  It
  14. should work under 5.5 as well.  I fixed a couple of obscure bugs in the
  15. process.  Version 2.2 is described in detail in Computer Language magazine,
  16. October 1987, page 57, "Build Your Own User Interface."  Version 2.4 works
  17. just the same, so see the article for more information.
  18.  
  19. All the I/O (input/output) routines except for dates are in the source file
  20. IO24.PAS.  Compile this to create a linkable Unit.
  21.  
  22. The program also demonstrates a number of ways to manipulate and perform
  23. calculations with dates.  All the date routines are in the file DATE24.PAS. 
  24. If you Use this file, you must Use IO24 first.
  25.  
  26. Put the compiler toggle {$V-} at the top of your program; this allows you
  27. to use strings of varying lengths.  Put the command "checkbreak := false"
  28. in the code before you read anything from the console; this disables
  29. checking for control-break and prevents the user from breaking out of the
  30. program.
  31.  
  32. If you have Fansi-Console or a similar video display speed-up utility
  33. installed in your computer it will interfere with Turbo Pascal 4.0 and
  34. above's direct video screen writes.  The solution is to either (a) remove
  35. the video speed-up utility before running your Turbo 4.0 and above program
  36. or (b) put the command "directvideo := false" at the beginning of your
  37. program.  If you do (b) Turbo uses ROM BIOS calls to display things on the
  38. screen instead of writing directly to video RAM.  Screen displays are then
  39. slower, about as fast as in Turbo 3.0, but are not glitched by the video
  40. speed-up utility.
  41.  
  42. The rest of this document describes the Unit files.
  43.  
  44.  
  45. IO24.PAS ------------------------------------------------------------------
  46.  
  47. The functions and procedures in this Unit allow you to control console I/O
  48. with great precision.  You can read and write strings, integers, reals and
  49. booleans at any place on the screen and prevent the user from entering
  50. garbage.  User input cannot crash your program!  You can easily control
  51. cursor movement through data entry forms displayed on the screen, not only
  52. from field to field but from screen to screen.
  53.  
  54. The data input procedures, READ_STR, READ_INT, etc., have an intentional
  55. side-effect on the global variable FLD, which controls which field the
  56. cursor goes to.  Study the code in procedures STRINGS, INTEGERS, REALS and
  57. BOOLEANS in the demonstration program to see how a case statement within a
  58. repeat-until loop uses this variable.  Study the code in procedure IO_DEMO
  59. in the demonstration program to see how a similar case statement within a
  60. repeat-until loop uses the global variable SCRN to control which screen is
  61. displayed.
  62.  
  63. The Interface section describes the global types, variables, procedures
  64. and functions that you can call from your program.  (There are a few more
  65. that are used by these procedures and functions, but are not intended to be
  66. called by themselves.)
  67.  
  68.  
  69. DATE24.PAS ----------------------------------------------------------------
  70.  
  71. The functions and procedures in this Unit allow you to read and write
  72. dates in a fashion similar to reading and writing strings, integers, reals
  73. and booleans.  You can also perform number of other functions on dates,
  74. such as count the number of days between two dates, test for leapyear,
  75. compute the previous and next day, etc.  To Use this unit you must first
  76. Use IO24.
  77.